<template>
  <div class="department">
    <page-search @query-click="handleQueryClick" @reset-click="handleResetClick"></page-search>
    <page-content ref="contentRef" @new-click="handleNewClick" @edit-click="handleEditClick"></page-content>
    <page-modal ref="modalRef"></page-modal>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue"
import pageSearch from "./c-cpns/page-search.vue"
import pageContent from "./c-cpns/page-content.vue"
import pageModal from "./c-cpns/page-modal.vue"
const contentRef = ref<InstanceType<typeof pageContent>>()
// 点击搜索
function handleQueryClick(queryInfo: any) {
  contentRef.value?.fetchPageListDate(queryInfo)
}
// 重置
function handleResetClick(){
  contentRef.value?.fetchPageListDate()
}
//点击modal
const modalRef=ref<InstanceType<typeof pageModal>>()
function handleNewClick(){
  modalRef.value?.setModalVisible(true)
}
function handleEditClick(itemData:any){
  modalRef.value?.setModalVisible(false,itemData)
}
</script>
<style scoped lang="less"></style>
